<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="__PUBLIC__/css/ydh.css" rel="stylesheet" id="lhgdialoglink">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>三鑫灯世界 - 已抢订单</title>
	<link rel="stylesheet" href="__PUBLIC__/css/c.css">
	<link rel="stylesheet" href="__PUBLIC__/css/page.css">
	<link rel="stylesheet" href="__PUBLIC__/css/header.css">
	<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
	<style type="text/css">
		#bg{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.7; opacity:.70; filter: alpha(opacity=70);}
		#show{display: none; position: absolute; top: 200px; left: 22%; width: 53%; height: 49%; padding: 8px; border: 8px solid #E8E9F7; background-color: white; z-index:1002; overflow: auto;}
		#fitTabletop{display: none;position: absolute; top: 152px; left: 22%;width: 53%;padding: 8px;border: 8px solid #013ca6; background-color:#013ca6; z-index:1005;text-align: right;}
		.menu2{background: #f5f5f5 !important;}
		.menu3{background: #fff !important;}
		.ovfHiden{overflow: hidden;}
	</style>
</head>
<body>
	<div class="r-wrap">
		<include file="./Application/Home/View/Public/head.html"/>
		<div class="main-wrap">
			<div class="order customer-order-list">
				<ul class="ui-tab-menu product-tab-menu">
					<li class="current"><a href="{:U('shop_qiang')}" class="menu2">待抢订单</a></li>
					<li class="current"><a href="{:U('shop_install_order')}" class="menu2 menu3">已抢订单</a></li>
					<li class="current"><a href="{:U('shop_send_order')}" class="menu2">指派订单</a></li>
					<li class="current"><a href="{:U('final_payment_order')}" class="menu2">尾款订单</a></li>
				</ul>
				<div class="main-t">
					<div class="table-wrap">
						<table class="fitTable">
							<thead>
								<tr class="">
									<th class="tl" style="width: 13%;">下单时间/订单号</th>
									<th class="tc" style="width: 8%;">商品总览</th>
									<th class="tc" style="width: 30%;">收货地址</th>
									<th class="tc" style="width: 5%;">收货人</th>
									<th class="tc" style="width: 8%;">联系电话</th>
									<th class="tc" style="width: 8%;">订单状态</th>
									<th class="tc" style="width: 8%;">安装费</th>
									<th class="tc" style="width: 8%;">安装状态</th>
									<th class="tc" style="width: 11%;">完成时间</th>
									<th class="tc" style="width: 15%;">操作</th>
								</tr>
							</thead>
							<tbody>
							<volist name="order_list" id="ol">
								<tr class="">
									<td class="order-num">
										<span>{$ol.add_time}</span>
										<span>{$ol.order_number}</span>
									</td>
									<td class="order-address tc">
										<button  onclick="showdiv('{$ol.order_number}');" style="cursor: pointer">查看详情</button>
									</td>
									<td class="tc order-logistics-status">
										<span>{$ol.province}{$ol.city}{$ol.county}{$ol.detailed_address}</span>
									</td>
									<td class="tc order-logistics-status">
										<span>{$ol.receiver}</span>
									</td>
									<td class="tc order-logistics-status">
										<span>{$ol.phone}</span>
									</td>
									<td class="tc order-logistics-status">
										<span>
											<switch name="ol['order_status']">
												<case value="-2"><span style="color:red;">已删除</span></case>
												<case value="1">待发货</case>
												<case value="2">待收货</case>
												<case value="3">已收货</case>
												<case value="4">申请换货</case>
												<case value="5">确认换货</case>
												<case value="6">已换货</case>
												<case value="7">申请退货</case>
												<case value="8">确认退货</case>
												<case value="9">已退货</case>
											</switch>
										</span>
									</td>
									<td class="tc">
										<span>
											<gt name="ol['total_install_price']" value="$configInfo['min_install_price']">
												￥{$ol.total_install_price}
											<else/>
												￥{$configInfo['min_install_price']}
											</gt>
										</span>
									</td>
									<td class="tc order-logistics-status">
										<eq name="ol.install_status" value="1">
											<span>已安装</span>
										<else/>
											<span style="color:red;">未安装</span>
										</eq>
									</td>
									<td class="tc order-logistics-status">
										<span>
											<eq name="ol.install_status" value="1">
												{$ol.install_time}
											<else/>
												-- --
											</eq>
										</span>
									</td>
									<td class="order-op tc">
										<if condition="$ol.install_status eq 1">
											-- --
										<else/>
											<button class="ui-btn ui-btn-theme submit" attr="{$ol.order_number}">点击完成</button>
										</if>
									</td>
								</tr>
							</volist>

							</tbody>
							<tfoot>
								<tr>
									<td class="tr pr10" colspan="7">
										<div class="pager">
											<div class="pages" align="center">
												<div style="padding-top: 5px" align="right">
													<div class="page-bottom">{$page}</div>
												</div>
											</div>
										</div>
									</td>
								</tr>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
			<input type="hidden" id="hdnIfOpenOnlinePay" value="0" autocomplete="off">
		</div>
	</div>

	<div id="bg" onclick="hidediv();"></div>
	<p id="fitTabletop" onclick="hidediv();" style="cursor: pointer;color:white;">关闭</p>
	<div id="show">
		<table class="fitTable">
			<thead>
			<tr class="">
				<th class="tc" style="width: 20%;"><h3>图片</h3></th>
				<th class="tc" style="width: 30%;"><h3>名称</h3></th>
				<th class="tc" style="width: 20%;"><h3>规格</h3></th>
				<th class="tc" style="width: 20%;"><h3>数量</h3></th>
				<th class="tc" style="width: 20%;"><h3>订单状态</h3></th>
			</tr>
			</thead>
			<tbody id="tb">
			<tr>

			</tr>
			</tbody>
		</table>
	</div>

	<script>
		function showdiv(order_number) {
			$('html,body').addClass('ovfHiden');
			$.ajax({
				url:"{:U('order_list')}",
				data:{'order_number':order_number},
				type:'post',
				success:function (e) {
					var da = JSON.parse(e);
					var list='';
					for(var i=0;i<da.length;i++){
						list +='<tr class="" style="border-bottom: 1px solid #f0f0f0">'
								+'<td class="order-num tc">'
								+'<span><img src="__ROOT__'+da[i].good_picture+'" style="width: 40%;"/></span>'
								+'</td>'
								+'<td class="order-address tc">'
								+'<span>'+da[i].good_name+'</span>'
								+'</td>'
								+'<td class="tc actualMoney">'
								+'<span>'+da[i].grade+'</span>'
								+'</td>'
								+'<td class="tc order-logistics-status">'
								+'<span> '+da[i].num+'</span>'
								+'</td>'
								+'<td class="tc order-logistics-status">'
								+'<span> '+da[i].order_status+'</span>'
								+'</td>'
								+'</tr>'
					}
					$('#tb').html(list);
					document.getElementById("bg").style.display ="block";
					document.getElementById("show").style.display ="block";
					document.getElementById("fitTabletop").style.display ="block";
				}
			})


		}
		function hidediv() {
			$('html,body').removeClass('ovfHiden');
			document.getElementById("bg").style.display ='none';
			document.getElementById("show").style.display ='none';
			document.getElementById("fitTabletop").style.display ="none";
		}

		$('.submit').click(function () {
			var order_number = $(this).attr('attr');
			$.ajax({
				url:"{:U('install_succ')}",
				data:{'order_number':order_number},
				type:'post',
				success:function (e) {
					if(e == 1){
						alert('操作成功');
						window.location.reload();
					}else{
						alert('数据异常，请重试');
						window.location.reload();
					}
				}
			})
		})
	</script>

	<!-- 设置分类隐藏/显示-->
	<script>
		$('.side-nav').find('.side-ul').hide();
		$('.side-nav').hover(function(){
			$(this).find('.side-ul').show();
		},function(){
			$(this).find('.side-ul').hide();
		})
		$('.side-ul> li').hover(function(){
			$(this).css('background','#fff').find('a:first-child').css('color','#000');
			$(this).find('.nav-items').show();
		},function(){
			$(this).css('background','#4f4f4f').find('a:first-child').css('color','#fff');
			$(this).find('.nav-items').hide();
		})
	</script>

</body>
</html>